package cn.lcsjsxy.yxc.objectoriented.抽象类.匿名子类;

public class PersonTest extends Person{
    public static void main(String[] args) {
        Person personTest=new PersonTest("老马香蕉拳");
    }

    public PersonTest() {
    }

    public PersonTest(String name) {
        super(name);
    }

    @Override
    public void printName(Person person) {
        System.out.println(person.name);
    }

}

abstract class Person{
    String name;

    public Person() {
    }

    public Person(String name) {
        this.name = name;
    }

    public abstract void printName(Person person);
}